package org.tea.inventory.db.service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.tea.inventory.db.dao.ApproveHistoryMapper;
import org.tea.inventory.db.domain.ApproveHistory;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;


@Service
public class ApproveHistoryService {

    @Resource
    private ApproveHistoryMapper approveHistoryMapper;


    /**
     * 添加驳回历史
     * @param approveHistory
     * @return
     */
    public int addApproveHistory(ApproveHistory approveHistory){
        return approveHistoryMapper.insertSelective(approveHistory);
    }

    public PageInfo<ApproveHistory> queryApproveHistory(String userName, Integer page, Integer limit, String sort, String order) {
        PageHelper.startPage(page, limit);
        List<ApproveHistory> list = approveHistoryMapper.selectApproveHistory(userName);
        PageInfo<ApproveHistory> pageInfo = new PageInfo<>(list);
        return pageInfo;
    }

    /**
     *
     */

}
